//
//  UIBarButtonItem+Extension.swift
//  个人微博
//
//  Created by 爱生活Geek on 16/10/21.
//  Copyright © 2016年 爱生活. All rights reserved.
//

import UIKit


extension UIBarButtonItem {
    
    // MARK: - 导航条按钮高粱设置
    convenience  init(title: String,fontSize: CGFloat = 16.0, target: AnyObject?,action: Selector) {
        
        let btn = UIButton(type: .custom)
        
        btn.setTitle(title, for: .normal)
        
        btn.setTitleColor(UIColor.darkGray, for: .normal)
        
        btn.setTitleColor(UIColor.orange, for: .highlighted)
        
        btn.addTarget(target, action: action, for: .touchUpInside)
        
        btn.sizeToFit()
        
        let view = UIView()
        
        view.addSubview(btn)
        
        view.frame = btn.bounds
        
        self.init(customView:view)
    }
    
}
